// router.js
import { createRouter, createWebHistory } from 'vue-router';

// 引入Vue组件
import Index from '@/views/Index/Index.vue';
import Less from '@/views/Less/Less.vue';
import Sass from '@/views/Sass/Sass.vue';
import Demo from '@/views/Demo/Demo.vue';
import Iframe from '@/views/Iframe/Iframe.vue';
import Pdf from '@/views/Pdf/Pdf.vue';
import NotFound from '@/views/NotFound/NotFound.vue';
/**
 * meta中
 *  isShowMenu  是否展示菜单
 *  isShowFooter  是否展示底部
 */
// 定义路由
const routes = [
    {
        path: '/',
        component: Index,
        meta: {
            isShowMenu: true,
            isShowFooter: true,
        }
    },
    {
        path: '/index',
        component: Index,
        meta: {
            isShowMenu: true,
            isShowFooter: true,
        }
    },
    {
        path: '/less',
        name: 'less',
        component: Less,
        meta: {
            isShowMenu: true,
            isShowFooter: true,
        }
    },
    {
        path: '/sass',
        name: 'sass',
        component: Sass,
        meta: {
            isShowMenu: true,
            isShowFooter: true,
        }
    },
    {
        path: '/demo',
        name: 'demo',
        component: Demo,
        meta: {
            isShowMenu: true,
            isShowFooter: true,
        }
    },
    {
        path: '/iframe',
        name: 'iframe',
        component: Iframe,
        meta: {
            isShowMenu: true,
            isShowFooter: true,
        }
    },
    {
        path: '/pdf',
        name: 'pdf',
        component: Pdf,
        meta: {
            isShowMenu: true,
            isShowFooter: true,
        }
    },
    {
        path: '/:pathMatch(.*)',
        name: 'notFound',
        component: NotFound,
        meta: {
        },
    }
];

// 创建router实例
const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;